package com.example.basic_components.Button

import androidx.compose.foundation.layout.Column
import androidx.compose.material.ExtendedFloatingActionButton
import androidx.compose.material.FloatingActionButton
import androidx.compose.material.Icon
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Favorite
import androidx.compose.runtime.Composable

//代表一个屏幕的主要行为
@Composable
fun FloatingActionButtonDemo() {
    Column() {
        //FAB通常和一个Icon一起使用
        FloatingActionButton(onClick = { /*TODO*/ }) {
            Icon(
                Icons.Filled.Favorite,
                contentDescription = null
            )
        }
        //除了普通的 FAB 之外，Compose 也提供了带有文字扩展的 FAB， ExtendedFloatingActionButton
        ExtendedFloatingActionButton(
            icon = {Icon(Icons.Filled.Favorite, contentDescription = null)},
            text = { Text(text = "Add My Fav") },
            onClick = { /*TODO*/ })
    }

}